<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>

            <c:if test="${currentPage>1}">
                <a href="${pathURL}?p=${currentPage-1}" >&lt;</a>
            </c:if>
            <c:if test="${currentPage==1}">
                <a href="${pathURL}?p=${currentPage}" >&lt;</a>
            </c:if>
            <c:forEach begin="${currentPage-3>0?currentPage-3:1}"
                       end="${currentPage+3<=totalPage?currentPage+3:totalPage}" step="1" var="k">
                <a href="${pathURL}?p=${k}">${k}</a>
            </c:forEach>
            <c:if test="${currentPage < totalPage}">
                <a href="${pathURL}?p=${currentPage+1}" >&gt;</a>
            </c:if>
            <c:if test="${currentPage == totalPage}">
                <a href="${pathURL}?p=${currentPage}" >&gt;</a>
            </c:if>
